{
  "data-root": "{{ docker_data }}",
  "exec-opts": ["native.cgroupdriver={{ docker_cgroups_driver }}"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "{{ docker_storage_driver }}",
  "metrics-addr" : "{{ inventory_hostname }}:{{ docker_exporter_port }}",
  "experimental" : true,
{% if proxy_env is defined and proxy_env is mapping %}
  "proxies": {
{% if 'http_proxy' in proxy_env %}
    "http-proxy": "{{ proxy_env['http_proxy'] }}",
{% elif 'all_proxy' in proxy_env %}
    "http-proxy": "{{ proxy_env['all_proxy'] }}",
{% endif %}
{% if 'https_proxy' in proxy_env %}
    "https-proxy": "{{ proxy_env['http_proxy'] }}",
{% elif 'all_proxy' in proxy_env %}
    "https-proxy": "{{ proxy_env['all_proxy'] }}",
{% endif %}
{% if 'no_proxy' in proxy_env %}
    "no-proxy": "{{ proxy_env['no_proxy'] }}"
{% else %}
    "no-proxy": "localhost,127.0.0.1,10.0.0.0/8,192.168.0.0/16,*.pigsty"
{% endif %}
  },
{% endif %}

  "registry-mirrors" : {{ docker_registry_mirrors | to_json }}
}
